using UnityDemo.LoggingUtility;

namespace UnityDemo.DemoCode.LifeTime
{
    internal abstract class BaseInstance : ILifeTime
    {
        public BaseInstance()
        {
            LogerInstance.Logger.Initialize(this);
        }


        public void PrintHashCode(int threadID)
        {
            var id = this.GetHashCode();
            LogerInstance.Logger.Info(this.GetType().Name + " Instance hash code " + id+" with Thread id ="+threadID);
        }


        public void PrintHashCode()
        {
            var id = this.GetHashCode();
            LogerInstance.Logger.Initialize(this);
            LogerInstance.Logger.Info(this.GetType().Name + " Instance has code " + id);
        }
    }
}